﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Drawing;

namespace Vortex.Drawing {

	/// <summary>
	/// 32 bit uint-based device capable color type
	/// </summary>
	public struct ColorU : IEquatable<ColorU> {
		/// <summary>
		/// Color value
		/// </summary>
		[XmlIgnore]
		public uint Argb;

		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct.
		/// </summary>
		/// <param name="value">The original uint value.</param>
		public ColorU(uint value) {
			Argb = value;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with color components.
		/// </summary>
		/// <param name="a">The a component.</param>
		/// <param name="r">The r component.</param>
		/// <param name="g">The g component.</param>
		/// <param name="b">The b component.</param>
		public ColorU(byte r, byte g, byte b, byte a) {
			Argb = (uint)a << 24 | (uint)r << 16 | (uint)g << 8 | (uint)b;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with color components.
		/// </summary>
		/// <param name="r">The r component.</param>
		/// <param name="g">The g component.</param>
		/// <param name="b">The b component.</param>
		public ColorU(byte r, byte g, byte b) : this(r, g, b, 255) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with specified component value for all of channels.
		/// </summary>
		/// <param name="v">The channels value in byte form</param>
		public ColorU(byte v)
			: this(v, v, v, v) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with specified component value for all of channels.
		/// </summary>
		/// <param name="v">The channels value in float form 0..1</param>
		public ColorU(float v)
			: this(v, v, v, v) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with color components.
		/// </summary>
		/// <param name="a">The a component.</param>
		/// <param name="r">The r component.</param>
		/// <param name="g">The g component.</param>
		/// <param name="b">The b component.</param>
		public ColorU(float r, float g, float b, float a) :
			this(				
				(byte)(MathHelper.Clamp(r, 0, 1) * 255f),
				(byte)(MathHelper.Clamp(g, 0, 1) * 255f),
				(byte)(MathHelper.Clamp(b, 0, 1) * 255f),
				(byte)(MathHelper.Clamp(a, 0, 1) * 255f)
			) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with color components.
		/// </summary>
		/// <param name="r">The r component.</param>
		/// <param name="g">The g component.</param>
		/// <param name="b">The b component.</param>		
		public ColorU(float r, float g, float b)
			: this(r, g, b, 1.0f) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with vector
		/// </summary>
		/// <param name="vector">The <see ref="Vector3"/> value.</param>
		public ColorU(Vector3 vector) : this(vector.X, vector.Y, vector.Z) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct with vector
		/// </summary>
		/// <param name="vector">The <see ref="Vector3"/> value.</param>
		public ColorU(Vector4 vector)
			: this(vector.X, vector.Y, vector.Z, vector.W) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> based on rgb and alpha value.
		/// </summary>
		/// <param name="rgb">The rgb part of color.</param>
		/// <param name="a">Alpha value in byte form</param>
		public ColorU(ColorU rgb, byte a)
			: this(rgb.Argb & 0xFFFFFF | (uint)a << 24) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> based on rgb and alpha value.
		/// </summary>
		/// <param name="rgb">The rgb part of color.</param>
		/// <param name="a">Alpha value if float form 0..1</param>
		public ColorU(ColorU rgb, float a)
			: this(rgb.Argb & 0xFFFFFF | (uint)(MathHelper.Clamp(a, 0, 1) * 255f) << 24) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ColorU"/> struct.
		/// </summary>
		/// <param name="color">The <see cref="System.Drawing.Color"/> value.</param>
		public ColorU(System.Drawing.Color color) {
			Argb = (uint)color.ToArgb();
		}

		#endregion

		#region Properties

		/// <summary>
		/// Gets or sets the alpha value of color in float representation (0..1).
		/// </summary>
		/// <value>The alpha component as float</value>
		[XmlIgnore]
		public float Af {
			get { return (Argb >> 24) / 255.0f; }
			set { Argb = Argb & 0x00FFFFFF | (uint)(value * 255.0f) << 24; }
		}

		/// <summary>
		/// Gets or sets the red value of color in float representation (0..1).
		/// </summary>
		/// <value>The red component as float</value>
		[XmlIgnore]
		public float Rf {
			get { return (Argb >> 16 & 0x000000FF) / 255.0f; }
			set { Argb = Argb & 0xFF00FFFF | (uint)(value * 255.0f) << 16; }
		}

		/// <summary>
		/// Gets or sets the green value of color in float representation (0..1).
		/// </summary>
		/// <value>The green component as float</value>
		[XmlIgnore]
		public float Gf {
			get { return (Argb >> 8 & 0x000000FF) / 255.0f; }
			set { Argb = Argb & 0xFFFF00FF | (uint)(value * 255.0f) << 8; }
		}

		/// <summary>
		/// Gets or sets the blue value of color in float representation (0..1).
		/// </summary>
		/// <value>The blue component as float</value>
		[XmlIgnore]
		public float Bf {
			get { return (Argb & 0x000000FF) / 255.0f; }
			set { Argb = Argb & 0xFFFFFF00 | (uint)(value * 255.0f); }
		}

		/// <summary>
		/// Gets or sets the alpha value of color in byte representation (0..255).
		/// </summary>
		/// <value>The alpha value as byte</value>
		[XmlAttribute]
		public byte A {
			get { return (byte)(Argb >> 24); }
			set { Argb = Argb & 0x00FFFFFF | (uint)value << 24; }
		}

		/// <summary>
		/// Gets or sets the red value of color in byte representation (0..255).
		/// </summary>
		/// <value>The red value as byte</value>
		[XmlAttribute]
		public byte R {
			get { return (byte)(Argb >> 16 & 0x000000FF); }
			set { Argb = Argb & 0xFF00FFFF | (uint)value << 16; }
		}

		/// <summary>
		/// Gets or sets the green value of color in byte representation (0..255).
		/// </summary>
		/// <value>The green value as byte</value>
		[XmlAttribute]
		public byte G {
			get { return (byte)(Argb >> 8 & 0x000000FF); }
			set { Argb = Argb & 0xFFFF00FF | (uint)value << 8; }
		}

		/// <summary>
		/// Gets or sets the green value of color in byte representation (0..255).
		/// </summary>
		/// <value>The green value as byte</value>
		[XmlAttribute]
		public byte B {
			get { return (byte)(Argb & 0x000000FF); }
			set { Argb = Argb & 0xFFFFFF00 | (uint)value; }
		}

		#endregion

		#region Component multiplication methods

		/// <summary>
		/// Multiplies the alpha channel value on factor.
		/// </summary>
		/// <param name="factor">The multiplication factor.</param>
		/// <returns>Color value with multiplied alpha</returns>
		public ColorU MultiplyAlpha(float factor) {
			ColorU color = this;
			color.Af = color.Af * factor;
			return color;
		}

		/// <summary>
		/// Multiplies the red channel value on factor.
		/// </summary>
		/// <param name="factor">The multiplication factor.</param>
		/// <returns>Color value with multiplied red component</returns>
		public ColorU MultiplyRed(float factor) {
			ColorU color = this;
			color.Rf = color.Rf * factor;
			return color;
		}

		/// <summary>
		/// Multiplies the green channel value on factor.
		/// </summary>
		/// <param name="factor">The multiplication factor.</param>
		/// <returns>Color value with multiplied green component</returns>
		public ColorU MultiplyGreen(float factor) {
			ColorU color = this;
			color.Gf = color.Gf * factor;
			return color;
		}

		/// <summary>
		/// Multiplies the blue channel value on factor.
		/// </summary>
		/// <param name="factor">The multiplication factor.</param>
		/// <returns>Color value with multiplied blue component</returns>
		public ColorU MultiplyBlue(float factor) {
			ColorU color = this;
			color.Bf = color.Bf * factor;
			return color;
		}

		#endregion

		#region Regular operations

		/// <summary>
		/// Multiplies specified color values.
		/// </summary>
		/// <param name="value1">The color value1.</param>
		/// <param name="value2">The color value2.</param>
		/// <returns>Multiplied color value</returns>
		public static ColorU Multiply(ColorU value1, ColorU value2) {
			return new ColorU(
				value1.Rf * value2.Rf,
				value1.Gf * value2.Gf,
				value1.Bf * value2.Bf,
				value1.Af * value2.Af
			);
		}

		/// <summary>
		/// Add specified color values.
		/// </summary>
		/// <param name="value1">The color value1.</param>
		/// <param name="value2">The color value2.</param>
		/// <returns>Added color value</returns>
		public static ColorU Add(ColorU value1, ColorU value2) {
			return new ColorU(
				value1.Rf + value2.Rf,
				value1.Gf + value2.Gf,
				value1.Bf + value2.Bf,
				value1.Af + value2.Af
			);
		}

		/// <summary>
		/// Subtract specified color values.
		/// </summary>
		/// <param name="value1">The color value1.</param>
		/// <param name="value2">The color value2.</param>
		/// <returns>Subtracted color value</returns>
		public static ColorU Subtract(ColorU value1, ColorU value2) {
			return new ColorU(
				value1.Rf - value2.Rf,
				value1.Gf - value2.Gf,
				value1.Bf - value2.Bf,
				value1.Af - value2.Af
			);
		}

		/// <summary>
		/// Subtract specified color values.
		/// </summary>
		/// <param name="value1">The color value1.</param>
		/// <param name="value2">The color value2.</param>
		/// <returns>Subtracted color value</returns>
		public static ColorU Lerp(ColorU value1, ColorU value2, float amount) {
			return new ColorU(
				MathHelper.Lerp(value1.Rf, value2.Rf, amount),
				MathHelper.Lerp(value1.Gf, value2.Gf, amount),
				MathHelper.Lerp(value1.Bf, value2.Bf, amount),
				MathHelper.Lerp(value1.Af, value2.Af, amount)
			);
		}

		/// <summary>
		/// Multiplies specified color value on factor.
		/// </summary>
		/// <param name="value1">The color value.</param>
		/// <param name="value2">The float value.</param>
		/// <returns>Multiplied color value</returns>
		public static ColorU Multiply(ColorU value1, float value2) {
			return new ColorU(
				value1.Rf * value2,
				value1.Gf * value2,
				value1.Bf * value2,
				value1.Af * value2
			);
		}

		/// <summary>
		/// Add specified factor with color.
		/// </summary>
		/// <param name="value1">The color value.</param>
		/// <param name="value2">The float value.</param>
		/// <returns>Added color value</returns>
		public static ColorU Add(ColorU value1, float value2) {
			return new ColorU(
				value1.Rf + value2,
				value1.Gf + value2,
				value1.Bf + value2,
				value1.Af + value2
			);
		}

		/// <summary>
		/// Subtract specified factor from color value
		/// </summary>
		/// <param name="value1">The color value.</param>
		/// <param name="value2">The float value.</param>
		/// <returns>Subtracted color value</returns>
		public static ColorU Subtract(ColorU value1, float value2) {
			return new ColorU(
				value1.Rf - value2,
				value1.Gf - value2,
				value1.Bf - value2,
				value1.Af - value2
			);
		}

		public ColorU Multiply(ColorU value) {
			return Multiply(this, value);
		}

		public ColorU Add(ColorU value) {
			return Add(this, value);
		}

		public ColorU Subtract(ColorU value) {
			return Subtract(this, value);
		}

		public ColorU Lerp(ColorU value, float amount) {
			return Lerp(this, value, amount);
		}

		public ColorU Multiply(float value) {
			return Multiply(this, value);
		}

		public ColorU Add(float value) {
			return Add(this, value);
		}

		public ColorU Subtract(float value) {
			return Subtract(this, value);
		}

		#endregion

		#region Operators

		public static bool operator ==(ColorU value1, ColorU value2) {
			return value1.Argb == value2.Argb;
		}

		public static bool operator !=(ColorU value1, ColorU value2) {
			return value1.Argb != value2.Argb;
		}

		public static ColorU operator * (ColorU value1, ColorU value2) {
			return Multiply(value1, value2);
		}

		public static ColorU operator +(ColorU value1, ColorU value2) {
			return Add(value1, value2);
		}

		public static ColorU operator -(ColorU value1, ColorU value2) {
			return Subtract(value1, value2);
		}

		public static ColorU operator *(ColorU value1, float value2) {
			return Multiply(value1, value2);
		}

		public static ColorU operator +(ColorU value1, float value2) {
			return Add(value1, value2);
		}

		public static ColorU operator -(ColorU value1, float value2) {
			return Subtract(value1, value2);
		}

		public static implicit operator Color(ColorU value) {
			return Color.FromArgb((int)value.Argb);
		}

		public static implicit operator ColorU(Color value) {
			return new ColorU(value);
		}

		/*
		public static implicit operator Color4F(ColorU value) {
			return new Color4F(value.A, value.R, value.G, value.B);
		}
		*/

		public static implicit operator uint(ColorU value) {
			return value.Argb;
		}

		public static implicit operator ColorU(uint value) {
			return new ColorU(value);
		}

		#endregion

		/// <summary>
		/// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
		/// </summary>
		/// <param name="other">The <see cref="System.Object"/> to compare with this instance.</param>
		/// <returns>
		/// 	<c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
		/// </returns>
		public override bool Equals(object other) {
			return other is ColorU ? Equals((ColorU)other) : false;
		}

		/// <summary>
		/// Returns a hash code for this color.
		/// </summary>
		/// <returns>
		/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
		/// </returns>
		public override int GetHashCode() {
			return (int)Argb;
		}

		/// <summary>
		/// Returns a <see cref="System.String"/> that represents this color.
		/// </summary>
		/// <returns>
		/// A <see cref="System.String"/> that represents this color.
		/// </returns>
		public override string ToString() {
			return string.Format("{{A:{0},R:{1},G:{2},B:{3}}}", A, R, G, B);
		}

		#region IEquatable<ColorU> Members

		/// <summary>
		/// Indicates whether the current color value is equal to another value.
		/// </summary>
		/// <param name="other">A color to compare with this object.</param>
		/// <returns>
		/// true if the current value is equal to the <param ref name="other"/> parameter; otherwise, false.
		/// </returns>
		public bool Equals(ColorU other) {
			return Argb == other.Argb;
		}

		#endregion

		#region ToXXX operators

		/// <summary>
		/// Converts the color to 3-component vector value (R, G, B).
		/// </summary>
		/// <returns><see cref="Vector3"/> value</returns>
		public Vector3 ToVector3() {
			return new Vector3(Rf, Gf, Bf);
		}

		/// <summary>
		/// Converts the color to 4-component vector value (A, R, G, B).
		/// </summary>
		/// <returns><see cref="Vector4"/> value</returns>
		public Vector4 ToVector4() {
			return new Vector4(Rf, Gf, Bf, Af);
		}

		/// <summary>
		/// Converts the <see cref="ColorU"/> instance into <see cref="System.Drawing.Color"/>
		/// </summary>
		/// <returns><see cref="System.Drawing.Color"/> representint this color</returns>
		public Color ToColor() {
			return Color.FromArgb((int)Argb);
		}

		#endregion

		#region Readable Colors

		///<summary>Blank color - white with maximum alpha value</summary>
		public static readonly ColorU Blank = new ColorU(0xFFFFFFFF);

		///<summary>Invisible color, 0 alpha and black (uint = 0) </summary>
		public static readonly ColorU Invisible = new ColorU(0);

		public static readonly ColorU AliceBlue = new ColorU(240, 248, 255);
		public static readonly ColorU AntiqueWhite = new ColorU(250, 235, 215);
		public static readonly ColorU Aqua = new ColorU(0, 255, 255);
		public static readonly ColorU Aquamarine = new ColorU(127, 255, 212);
		public static readonly ColorU Azure = new ColorU(240, 255, 255);
		public static readonly ColorU Beige = new ColorU(245, 245, 220);
		public static readonly ColorU Bisque = new ColorU(255, 228, 196);
		public static readonly ColorU Black = new ColorU(0, 0, 0);
		public static readonly ColorU BlanchedAlmond = new ColorU(255, 235, 205);
		public static readonly ColorU Blue = new ColorU(0, 0, 255);
		public static readonly ColorU BlueViolet = new ColorU(138, 43, 226);
		public static readonly ColorU Brown = new ColorU(165, 42, 42);
		public static readonly ColorU BurlyWood = new ColorU(222, 184, 135);
		public static readonly ColorU CadetBlue = new ColorU(95, 158, 160);
		public static readonly ColorU ChartReuse = new ColorU(127, 255, 0);
		public static readonly ColorU Chocolate = new ColorU(210, 105, 30);
		public static readonly ColorU Coral = new ColorU(255, 127, 80);
		public static readonly ColorU CornflowerBlue = new ColorU(100, 149, 237);
		public static readonly ColorU Cornsilk = new ColorU(255, 248, 220);
		public static readonly ColorU Crimson = new ColorU(220, 20, 60);
		public static readonly ColorU Cyan = new ColorU(0, 255, 255);
		public static readonly ColorU Darkblue = new ColorU(0, 0, 139);
		public static readonly ColorU DarkCyan = new ColorU(0, 139, 139);
		public static readonly ColorU DarkGoldenrod = new ColorU(184, 134, 11);
		public static readonly ColorU DarkGray = new ColorU(169, 169, 169);
		public static readonly ColorU DarkGreen = new ColorU(0, 100, 0);
		public static readonly ColorU DarkGrey = new ColorU(169, 169, 169);
		public static readonly ColorU DarkKhaki = new ColorU(189, 183, 107);
		public static readonly ColorU DarkMagenta = new ColorU(139, 0, 139);
		public static readonly ColorU DarkOliveGreen = new ColorU(85, 107, 47);
		public static readonly ColorU DarkOrange = new ColorU(255, 140, 0);
		public static readonly ColorU DarkOrchid = new ColorU(153, 50, 204);
		public static readonly ColorU DarkRed = new ColorU(139, 0, 0);
		public static readonly ColorU DarkSalmon = new ColorU(233, 150, 122);
		public static readonly ColorU DarkSeaGreen = new ColorU(143, 188, 143);
		public static readonly ColorU DarkSlateBlue = new ColorU(72, 61, 139);
		public static readonly ColorU DarkSlateGray = new ColorU(47, 79, 79);
		public static readonly ColorU DarkSlateGrey = new ColorU(47, 79, 79);
		public static readonly ColorU DarkTurquoise = new ColorU(0, 206, 209);
		public static readonly ColorU DarkViolet = new ColorU(148, 0, 211);
		public static readonly ColorU DeepPink = new ColorU(255, 20, 147);
		public static readonly ColorU DeepSkyBlue = new ColorU(0, 191, 255);
		public static readonly ColorU DimGray = new ColorU(105, 105, 105);
		public static readonly ColorU DimGrey = new ColorU(105, 105, 105);
		public static readonly ColorU DodgerBlue = new ColorU(30, 144, 255);
		public static readonly ColorU FireBrick = new ColorU(178, 34, 34);
		public static readonly ColorU FloralWhite = new ColorU(255, 250, 240);
		public static readonly ColorU ForestGreen = new ColorU(34, 139, 34);
		public static readonly ColorU Fuchsia = new ColorU(255, 0, 255);
		public static readonly ColorU Gainsboro = new ColorU(220, 220, 220);
		public static readonly ColorU GhostWhite = new ColorU(248, 248, 255);
		public static readonly ColorU Gold = new ColorU(255, 215, 0);
		public static readonly ColorU Goldenrod = new ColorU(218, 165, 32);
		public static readonly ColorU Gray = new ColorU(128, 128, 128);
		public static readonly ColorU Grey = new ColorU(128, 128, 128);
		public static readonly ColorU Green = new ColorU(0, 128, 0);
		public static readonly ColorU GreenYellow = new ColorU(173, 255, 47);
		public static readonly ColorU Honeydew = new ColorU(240, 255, 240);
		public static readonly ColorU HotPink = new ColorU(255, 105, 180);
		public static readonly ColorU IndianRed = new ColorU(205, 92, 92);
		public static readonly ColorU Indigo = new ColorU(75, 0, 130);
		public static readonly ColorU Ivory = new ColorU(255, 255, 240);
		public static readonly ColorU Khaki = new ColorU(240, 230, 140);
		public static readonly ColorU Lavender = new ColorU(230, 230, 250);
		public static readonly ColorU LavenderBlush = new ColorU(255, 240, 245);
		public static readonly ColorU LawnGreen = new ColorU(124, 252, 0);
		public static readonly ColorU LemonChiffon = new ColorU(255, 250, 205);
		public static readonly ColorU LightBlue = new ColorU(173, 216, 230);
		public static readonly ColorU LightCoral = new ColorU(240, 128, 128);
		public static readonly ColorU LightCyan = new ColorU(224, 255, 255);
		public static readonly ColorU LightGoldenrodYellow = new ColorU(250, 250, 210);
		public static readonly ColorU LightGray = new ColorU(211, 211, 211);
		public static readonly ColorU LightGreen = new ColorU(144, 238, 144);
		public static readonly ColorU LightGrey = new ColorU(211, 211, 211);
		public static readonly ColorU LightPink = new ColorU(255, 182, 193);
		public static readonly ColorU LightSalmon = new ColorU(255, 160, 122);
		public static readonly ColorU LightSeaGreen = new ColorU(32, 178, 170);
		public static readonly ColorU LightSkyBlue = new ColorU(135, 206, 250);
		public static readonly ColorU LightGlateGray = new ColorU(119, 136, 153);
		public static readonly ColorU LightSlateGrey = new ColorU(119, 136, 153);
		public static readonly ColorU LightSteelBlue = new ColorU(176, 196, 222);
		public static readonly ColorU LightYellow = new ColorU(255, 255, 224);
		public static readonly ColorU Lime = new ColorU(0, 255, 0);
		public static readonly ColorU LimeGreen = new ColorU(50, 205, 50);
		public static readonly ColorU Linen = new ColorU(250, 240, 230);
		public static readonly ColorU Magenta = new ColorU(255, 0, 255);
		public static readonly ColorU Maroon = new ColorU(128, 0, 0);
		public static readonly ColorU MediumAquamarine = new ColorU(102, 205, 170);
		public static readonly ColorU MediumBlue = new ColorU(0, 0, 205);
		public static readonly ColorU MediumOrchid = new ColorU(186, 85, 211);
		public static readonly ColorU MediumPurple = new ColorU(147, 112, 219);
		public static readonly ColorU MediumSeaGreen = new ColorU(60, 179, 113);
		public static readonly ColorU MediumSlateBlue = new ColorU(123, 104, 238);
		public static readonly ColorU MediumSpringGreen = new ColorU(0, 250, 154);
		public static readonly ColorU MediumTurquoise = new ColorU(72, 209, 204);
		public static readonly ColorU MediumVioletRed = new ColorU(199, 21, 133);
		public static readonly ColorU MidnightBlue = new ColorU(25, 25, 112);
		public static readonly ColorU MintCream = new ColorU(245, 255, 250);
		public static readonly ColorU MistyRose = new ColorU(255, 228, 225);
		public static readonly ColorU Moccasin = new ColorU(255, 228, 181);
		public static readonly ColorU NavajoWhite = new ColorU(255, 222, 173);
		public static readonly ColorU Navy = new ColorU(0, 0, 128);
		public static readonly ColorU OldLace = new ColorU(253, 245, 230);
		public static readonly ColorU Olive = new ColorU(128, 128, 0);
		public static readonly ColorU OliveDrab = new ColorU(107, 142, 35);
		public static readonly ColorU Orange = new ColorU(255, 165, 0);
		public static readonly ColorU OrangeRed = new ColorU(255, 69, 0);
		public static readonly ColorU Orchid = new ColorU(218, 112, 214);
		public static readonly ColorU PaleGoldenrod = new ColorU(238, 232, 170);
		public static readonly ColorU PaleGreen = new ColorU(152, 251, 152);
		public static readonly ColorU PaleTurquoise = new ColorU(175, 238, 238);
		public static readonly ColorU PaleVioletRed = new ColorU(219, 112, 147);
		public static readonly ColorU PapayaWhip = new ColorU(255, 239, 213);
		public static readonly ColorU PeachPuff = new ColorU(255, 218, 185);
		public static readonly ColorU Peru = new ColorU(205, 133, 63);
		public static readonly ColorU Pink = new ColorU(255, 192, 203);
		public static readonly ColorU Plum = new ColorU(221, 160, 221);
		public static readonly ColorU PowderBlue = new ColorU(176, 224, 230);
		public static readonly ColorU Purple = new ColorU(128, 0, 128);
		public static readonly ColorU Red = new ColorU(255, 0, 0);
		public static readonly ColorU RosyBrown = new ColorU(188, 143, 143);
		public static readonly ColorU RoyalBlue = new ColorU(65, 105, 225);
		public static readonly ColorU SaddleBrown = new ColorU(139, 69, 19);
		public static readonly ColorU Salmon = new ColorU(250, 128, 114);
		public static readonly ColorU SandyBrown = new ColorU(244, 164, 96);
		public static readonly ColorU SeaGreen = new ColorU(46, 139, 87);
		public static readonly ColorU SeaShell = new ColorU(255, 245, 238);
		public static readonly ColorU Sienna = new ColorU(160, 82, 45);
		public static readonly ColorU Silver = new ColorU(192, 192, 192);
		public static readonly ColorU SkyBlue = new ColorU(135, 206, 235);
		public static readonly ColorU SlateBlue = new ColorU(106, 90, 205);
		public static readonly ColorU SlateGray = new ColorU(112, 128, 144);
		public static readonly ColorU SlateGrey = new ColorU(112, 128, 144);
		public static readonly ColorU Snow = new ColorU(255, 250, 250);
		public static readonly ColorU SpringGreen = new ColorU(0, 255, 127);
		public static readonly ColorU SteelBlue = new ColorU(70, 130, 180);
		public static readonly ColorU Tan = new ColorU(210, 180, 140);
		public static readonly ColorU Teal = new ColorU(0, 128, 128);
		public static readonly ColorU Thistle = new ColorU(216, 191, 216);
		public static readonly ColorU Tomato = new ColorU(255, 99, 71);
		public static readonly ColorU Turquoise = new ColorU(64, 224, 208);
		public static readonly ColorU Violet = new ColorU(238, 130, 238);
		public static readonly ColorU Wheat = new ColorU(245, 222, 179);
		public static readonly ColorU White = new ColorU(255, 255, 255);
		public static readonly ColorU WhiteSmoke = new ColorU(245, 245, 245);
		public static readonly ColorU Yellow = new ColorU(255, 255, 0);
		public static readonly ColorU YellowGreen = new ColorU(154, 205, 50);

		#endregion
	}
}
